﻿<%@ Page Language="C#" MasterPageFile="~/Back/BackgroundMain.master" AutoEventWireup="true"
    CodeFile="BgArticleList.aspx.cs" Inherits="Back_BgArticleList" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager runat="server" ID="Script1">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div>
                <div class="tablecontent">
                    <div class="centertop" id="dvNav" runat="server">
                        当前位置：<a href="BgArticleList.aspx">中共重庆市沙坪坝区委统一战线工作部</a>&nbsp;>>&nbsp;<a href="BgArticleList.aspx">文章管理</a></div>
                    <div class="choice" style="padding-top: 5px; padding-bottom: 5px">
                        栏目选项：<asp:DropDownList ID="ddl_Types" runat="server" AutoPostBack="True" DataTextField="TypeName"
                            OnSelectedIndexChanged="ddl_Types_SelectedIndexChanged" CssClass="dropdownlist"
                            DataValueField="TypeCode">
                            <asp:ListItem></asp:ListItem>
                        </asp:DropDownList>
                        <asp:DropDownList ID="ddl_ChildTypes" runat="server" AutoPostBack="True" DataTextField="TypeName"
                            DataValueField="TypeCode" OnSelectedIndexChanged="ddl_ChildTypes_SelectedIndexChanged"
                            CssClass="dropdownlist">
                            <asp:ListItem></asp:ListItem>
                        </asp:DropDownList>
                        <br />
                    </div>
                    <div style="text-align: center; margin: auto">
                        <asp:GridView ID="gv_ArticalList" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                            EmptyDataText="没有相关类型的文章" DataKeyNames="ID" OnPageIndexChanging="gv_ArticalList_PageIndexChanging"
                            Width="650px" CellPadding="4" ForeColor="#333333" GridLines="None" 
                            onrowcreated="gv_ArticalList_RowCreated">
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <RowStyle BackColor="#EFF3FB" />
                            <Columns>
                                <asp:BoundField DataField="ID" HeaderText="文章ID" ReadOnly="True" Visible="false"
                                    SortExpression="ID" />
                                <asp:TemplateField ItemStyle-Width="50px" HeaderText="编号">
                                    <ItemTemplate>
                                        <%#Container.DataItemIndex + 1%>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField ItemStyle-Width="80px" DataField="TypeName" HeaderText="文章类别" ReadOnly="True"
                                    SortExpression="TypeName" />
                                <asp:TemplateField>
                                    <HeaderTemplate>
                                        文章标题
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <a target="_blank" href='../Content.aspx?articleID=<%#Eval("ID")%>'>
                                            <%#CutString(Eval("Title").ToString())%></a>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField ItemStyle-Width="78px" DataField="ViewTimes" HeaderText="浏览次数" ReadOnly="True"
                                    SortExpression="ViewTimes" />
                                <asp:BoundField ItemStyle-Width="128px" DataField="CreateTime" HeaderText="创建时间"
                                    ReadOnly="True" SortExpression="CreateTime" />
                                <asp:TemplateField ItemStyle-Width="30px">
                                    <HeaderTemplate>
                                        删除
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:Button ID="btn_Del" runat="server" CommandArgument="DelCmda" CausesValidation="false"
                                            Text="删除" OnClientClick="javascript: return confirm('您真的要删除这篇文章吗?');" OnClick="btn_Del_Click" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField ItemStyle-Width="30px">
                                    <HeaderTemplate>
                                        编辑
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:Button ID="btn_Eidt" runat="server" CommandArgument="EditCmda" CausesValidation="false"
                                            Text="编辑" OnClick="btn_Eidt_Click" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <PagerSettings FirstPageText="首页" LastPageText="末页" NextPageText="下页" PreviousPageText="上页" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <EditRowStyle BackColor="#2461BF" />
                            <AlternatingRowStyle BackColor="White" />
                        </asp:GridView>
                    </div>
                    <div class="buttonlist">
                        <asp:Button ID="btn_AddArticle" runat="server" CssClass="button" OnClick="btn_AddArticle_Click"
                            Text="添加文章" />
                    </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
